From 60256c02992acc0256d98401232b32bad3fddfc0 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 27 Apr 2005 10:37:26 +0000 Subject: [PATCH] bitkeeper revision 1.1385.1.4 (426f6b66K5Xrx0v2--zUfkahi8mIUw) Invalidate p2m entries when blocks of phys memory are handed back to Xen allocation pool. This is the correct fix for the "dom0 kernel crashes when I create a domU" bug. Signed-off-by: Keir Fraser --- linux-2.6.11-xen-sparse/arch/xen/i386/mm/hypervisor.c | 3 ++- linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/hypervisor.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/hypervisor.c b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/hypervisor.c index 0c7738276b..16b253866f 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/hypervisor.c +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/hypervisor.c @@ -211,7 +211,8 @@ unsigned long allocate_empty_lowmem_region(unsigned long pages) pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); pfn_array[i] = pte->pte_low >> PAGE_SHIFT; HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE), __pte_ma(0), 0); - phys_to_machine_mapping[__pa(vstart)>>PAGE_SHIFT] = INVALID_P2M_ENTRY; + phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = + INVALID_P2M_ENTRY; } flush_tlb_all(); diff --git a/linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/hypervisor.c b/linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/hypervisor.c index ad04d3f1f2..83a922954c 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/hypervisor.c +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/hypervisor.c @@ -258,7 +258,8 @@ unsigned long allocate_empty_lowmem_region(unsigned long pages) pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); pfn_array[i] = pte->pte >> PAGE_SHIFT; xen_l1_entry_update(pte, 0); - phys_to_machine_mapping[__pa(vstart)>>PAGE_SHIFT] = (u32)INVALID_P2M_ENTRY; + phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = + (u32)INVALID_P2M_ENTRY; } /* Flush updates through and flush the TLB. */ -- 2.30.2